libxl: Fix migration of HVM guests
authorIan Campbell <ian.campbell@citrix.com>
Thu, 28 Oct 2010 11:19:43 +0000 (12:19 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 28 Oct 2010 11:19:43 +0000 (12:19 +0100)
commit2526ff6cc98fc971041442e63bfe43bdc8bed9d2
treee3b4af37eb7f696b4cee9b7bebe3225f6aac3ef9
parent7134cbcc19fc72720338009ef2e93c96f9ba2963
libxl: Fix migration of HVM guests

In the default "QemuDeviceModelRecord"-style HVM tail of the migration
protocol the size of the qemu save record is unknown at the receiver
and therefore it must read until EOF. This is not compatible with the
xl migration protocol which contains a post-migration handshake and
therefore cannot close the socket on the sending end.

What is required is an explicit length field for the save record,
which the "RemusDeviceModelState"-style HVM tail includes.

Rather than overload the "RemusDeviceModelState" name for a non-Remus
use case (on off chance that they need to diverge for some reason in
the future) introduce a third style called "DeviceModelRecord0002"
which is identical to current "RemusDeviceModelState"-style.

Hopefully the inclusion of a number here will allow easier extension
in the future without needing to come up with increasingly less
helpful names!

Also propagate errors from xc_domain_save and
libxl__domain_suspend_common to callers.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_domain_restore.c
tools/libxc/xg_save_restore.h
tools/libxl/libxl.c
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.h